﻿using System;
using System.Net;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;

namespace HobSoft.SoccerBet2014.Domain.Models.Site
{
    using Core;
    [Serializable]
    [DataContract]
    public class AccountCookie : IModel
    {
        public AccountCookie()
        {
            Cookie = new PersistentCookie();
        }

        [PrimaryKey]
        [DataMember(IsRequired = true)]
        public long Key { get; set; }
        [Key]
        [DataMember(IsRequired = true)]
        public byte BmID { get; set; }
        [Key]
        [Required]
        [MaxLength(50)]
        [MinLength(2)]
        [DataMember(IsRequired = true)]
        public string Account { get; set; }
        [DataMember]
        public DateTime LastUpdate { get; set; }

        [Required]
        [DataMember]
        public PersistentCookie Cookie
        {
            get;
            set;
        }
    }
}
